//
//  GGFuntionCell.m
//  Gunterapple
//
//  Created by 热带雨林 on 2020/4/4.
//  Copyright © 2020 热带雨林. All rights reserved.
//

#import "GGFuntionCell.h"
#import "ZFBFunctionModel.h"
#import "GGAddtion.h"
@interface GGFuntionCell ()
@property (nonatomic, weak)UIImageView *icon;
@property (nonatomic, weak)UILabel *name;
@end

@implementation GGFuntionCell
- (instancetype)initWithFrame:(CGRect)frame{
    if(self = [super initWithFrame:frame]){
        [self setUI];
    }
    return self;
}
- (void)setUI{
    self.backgroundColor = [UIColor whiteColor];
    UIImageView *icon = [[UIImageView alloc]initWithFrame:CGRectZero];
    self.icon = icon;
    [self.contentView addSubview:icon];
    UILabel *name = [[UILabel alloc]init];
    self.name = name;
    self.name.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.name];
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_offset(CGPointMake(0, -15));
        make.size.mas_equalTo(CGSizeMake(27, 27));
    }];
    [self.name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.icon.mas_bottom).offset(8);
        make.centerX.equalTo(self.contentView);
    }];
}
- (void)setModel:(ZFBFunctionModel *)model{
    _model = model;
    self.icon.image = [UIImage imageNamed:model.icon];
    self.name.text = model.name;
}
@end
